import reLogin from '@/common/common'
import Vue from 'vue'
import VueRouter from 'vue-router'

import routerMap from './routerMap'

Vue.use(VueRouter)

const routes = routerMap

const router = new VueRouter({
    mode: 'history',
    routes
})

router.beforeEach((to, from, next) => {
    reLogin(next());
})

export default router
